//引入axios实例
import http from "@/util/request";

export function login(val){
    return http({
        method:"GET",
        url:"/admin/login",
        params: val
    })
}

export function checkLogin(){
    return http({
        method:"GET",
        url:"/admin/checkLogin",
    })
}

export function logout(){
    return http({
        method:"GET",
        url:"/admin/logout",
    })
}

export function getAdminInfo(){
    return http({
        method:"GET",
        url:"/admin/getAdminInfo",
    })
}

export function getCode(val) {
    return http({
        method: "GET",
        url: "/validate/get",
        params: val
    })
}

//查询管理员信息
export function selectAdminsByCondition(val) {
    return http({
        method: "GET",
        url: "/admin/selectAdminsByCondition",
        params: val
    })
}

//重置管理员密码
export function resetPassword(adminId){
    return http({
        method: "PUT",
        url: `/admin/resetPassword/${adminId}`,
    })
}

//封禁管理员
export function deleteAdmin(val){
    return http({
        method:"Delete",
        url: `/admin/deleteAdmin`,
        params: val
    })
}

